package com.ruoyi.dingtalk.service;

import com.taobao.api.ApiException;

/**
 * 钉钉api服务
 *
 * @author xueyu
 */
public interface DingTalkApiService {


    static final String DING_TOKEN_KEY = "ding_token_key";

    /**
     * 钉钉token失效时间(7200秒)
     */
    static final Integer DING_TOKEN_EXPIRE_TIME = 7200000;

    /**
     * 获取AccessToken
     *
     * @param ddAppKey    钉钉应用key
     * @param ddAppSecret 钉钉应用密钥
     * @return String
     * @throws ApiException 钉钉接口ApiException
     */
    String getAccessToken(String ddAppKey, String ddAppSecret) throws ApiException;


    /**
     * 获取钉钉签名jsapiTicket
     *
     * @param ddAppKey    钉钉应用AppKey
     * @param accessToken 用户授权码
     * @return String
     * @throws ApiException ApiException
     */
    String getJsapiTicket(String ddAppKey, String accessToken) throws ApiException;
}
